package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.service.JournalService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ldl.plus
 * @date 2020年04月25日  0:04
 * 日志
 */
@RestController
@RequestMapping("/journal")
public class JournalController {

    @Reference
    private JournalService journalService;

    @PostMapping("/findPage")
    public Result findPage(@RequestBody QueryPageBean queryPageBean) {
        try {
            PageResult journals = journalService.findPage(queryPageBean);
            return new Result(true, "查询日志成功", journals);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false, "查询日志失败");
        }
    }
}
